package org.example.Blog;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.naming.ldap.PagedResultsControl;
import java.sql.*;
import java.text.SimpleDateFormat;

public class Blog {
    //博客的id
    private Integer blogId;
    //博客的标题
    private String blogTitle;
    //博客的正文
    private String blogContent;
    //博客的提交时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp postTime;
    //博客创作者
    private Integer userId;

    public Integer getBlogId() {
        return blogId;
    }

    public void setBlogId(Integer blogId) {
        this.blogId = blogId;
    }

    public String getBlogTitle() {
        return blogTitle;
    }

    public void setBlogTitle(String blogTitle) {
        this.blogTitle = blogTitle;
    }

    public String getBlogContent() {
        return blogContent;
    }

    public void setBlogContent(String blogContent) {
        this.blogContent = blogContent;
    }

    public Timestamp getPostTime() {
        return postTime;
    }

    public void setPostTime(Timestamp postTime) {
        this.postTime = postTime;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "blogId:"+getBlogId()+"\n"+"blogTitle:"+getBlogTitle()+"\n"+"blogContent:"+getBlogContent()+"\n"+"postTime:"+getPostTime()+"\n"+"userId:"+getUserId()+"\n";
    }
}
